<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>确认订单信息 - ${web.name}${web.additionalTitle!}</title>
<link href="${root}/u/css/global.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/layout.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/checkout.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/memeber.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/buy.css" type="text/css" rel="stylesheet" />
<script src="${sysResRoot}/jquery.js" type="text/javascript"></script>
<script src="${root}/u/js/cart_sure.js"  type="text/javascript"></script>
<script type="text/javascript"> 
var URLPrefix = {"url":"${base}"};
</script>
<script type="text/javascript">
$(function() {
	$("#jvForm").validate();
});

function checkReceive(){
	if($("#provinceId").val()==''||$("#provinceId").val()==null){
           alert("请选择所在地址!");
           return;
	}
	if($("#tel").val()==''&&$("#phone").val()==''){
        alert("手机跟电话至少有一项必填");
        return;
	}
	$("#jvForm").attr("action","../shopMemberAddress/address_save.jspx");
	$("#jvForm").submit();
}

function checkOrder(){
	if($("input[name='deliveryInfo']").length<=0){
     alert("请添加邮寄地址");
     return;
	} 
	var pd=false;
	$("input[name='deliveryInfo']").each(function(){
		if($(this).attr("checked")){
              pd=true;
		}  
	});
	if(!pd){
         alert("请选择邮寄地址！");
         return;
	}
	$("#addrInputDiv").html('');
	$("#jvForm").attr("action","../yushou/order_shipping.jspx");
	$("#jvForm").submit();
}
</script>
</head>
<body>
[#include "../include/页头顶栏.html"/]
<div id="head">
	 [#include "../include/页头搜索栏.html"/]
    [#include "../include/页头导航栏.html"/]
</div>
<div id="checkoutUI" class="mt10">
   <div id="errorMsgDisplayDiv" style="z-index:1000;"></div>
    <form id="jvForm" action="../order/order_shipping.jspx" method="post">
     <input type="hidden" value="${product.id}" name="productid"/>
      <input type="hidden" value="${count}" name="count"/>
       <div id="receiver_buffer_window" class="delivery mb10">
       <ul class="step clearfix mt10">
        <li><span>STEP 1.</span>查看购物车</li><li><span>STEP 2.</span>选择店铺</li>
        <li class="on"><span>STEP 3.</span>确定认订单信息</li><li><span>STEP 4.</span>成功提交订单</li>
       </ul>
       <div class="title"><h2>确认收货信息</h2></div>
       <div id="inputUI_rece" class="rece_box">
	         <p class="adds_btn" id="btn_away_ui">&nbsp;</p>
	          [#if smalist?size gt 0]
                 [#list smalist as sma]
	              <p class="adds_list adds_selected">
	               <label class="pointer">
	                 <input type="radio" name="deliveryInfo" class="delivery_info" value="${sma.id}" 
	                 [#if sma.isDefault]checked="checked"[/#if]"/>
	                  <span class="text" style="position:relative">
	                   ${sma.username!}&nbsp;${sma.province.name!}&nbsp;${sma.city.name!}
	                    &nbsp;${sma.detailaddress!}&nbsp;${sma.tel!}&nbsp;&nbsp;&nbsp;&nbsp;
	                    [#if store??]
	                  <a href="../shopMemberAddress/address_delete.jspx?id=${sma.id}&returnUrl=../cart/checkout_shipping.jspx?storeId=${store.id}" class="w44">删除|</a>
                      <a href="../shopMemberAddress/address_default.jspx?id=${sma.id}&returnUrl=../cart/checkout_shipping.jspx?storeId=${store.id}">设为默认</a>
                      
                      [#else]
                       <a href="../shopMemberAddress/address_delete.jspx?id=${sma.id}&returnUrl=../cart/checkout_shipping.jspx" class="w44">删除|</a>
                      <a href="../shopMemberAddress/address_default.jspx?id=${sma.id}&returnUrl=../cart/checkout_shipping.jspx">设为默认</a>
                      [/#if]
	                 </span>
	              </label>
	             </p>
	           [/#list]
              [/#if]
        <p class="add_adds">
         <span class="btn_span" onclick="jQuery('#addrInputDiv').show();">添加新地址</span>
         <span class="btn_span" onclick="jQuery('#addrInputDiv').hide();">取消新地址</span>
       </p>
        <hr class="delivery_hr" />
            <div id="addrInputDiv" class="adress_edit2 none">
                  <h3 class="h3">请填写收货人信息：</h3>
                   <p class="info_form">
                     <label for="user_name" class="lab"><em>*</em>收&nbsp;货 &nbsp;人：</label>
                       <input type="text" id="receiverName" name="username" class="user_name text required" />
                       <span id="nameError" class="prompt"></span>
                   </p>
                   <p class="info_form">
                     <label for="user_name" class="lab"><em>*</em>性&nbsp;&nbsp;&nbsp;&nbsp;别：</label>&nbsp;
                     <input type="radio" name="gender" value="true" checked/>男&nbsp;&nbsp;&nbsp;&nbsp;
		             <input type="radio" name="gender" value="false"/>女
                   </p>
                   <p class="info_form">
                     <label for="select_province" class="lab"><em>*</em>收货地址：</label>
                      <select id="provinceId" name="provinceId" onchange="getResultCity(this.value)"  >
	                      <option value="">--请选择--</option>
	                      [#list plist as province]
		                       <option value="${province.id!}">${province.name!}</option>
                          [/#list]
                        </select>
                      <span id="itemcity"></span>
                      <span id="itemarea"></span>
                  </p>
                   <p class="info_form">
                      <label for="user_adress" class="lab"><em>*</em>详细地址：</label>
                      <input id="detailAddress" name="detailaddress" class="user_adress text required" type="text" />
                  </p>
                   <p class="info_form">
                      <label for="user_adress" class="lab"><em>*</em>邮政编码：</label>
                      <input id="postCode" name="postCode" class="user_phone text required digits" type="text" />
                  </p>
                  <p class="info_form">
                       <label for="user_phone" class="lab">手机号码：</label>
                       <input type="text" id="tel" name="tel" class="user_phone text digits"  />
                       <span id="mobileError" class="prompt">手机或电话必填一种</span>
                 </p>
                  <p class="info_form">
                       <label for="user_phone" class="lab"> 固定电话：</label>
                        <input type="text"  id="areaCode" name="areaCode"  size="4"  maxlength="4" class="user_areaCode text digits"/>-
		                <input type="text" id="phone" name="phone"  size="14" maxlength="10" class="user_phone text digits"/>-
		               <input  type="text" id="extNumber" name="extNumber"  size="6"  maxlength="6" class="user_extNumber text digits"/>
		                                     区号(3到4位数字，可选)-电话号码(7到8位数字)-分机号(最多6位数字，可选)
                 </p>
               <p class="info_form">
                      <input type="checkbox" onclick="$('#isDefault').val(this.checked)"/>
                      <input type="hidden" id="isDefault" name="isDefault" value="false"/>
                     <label for="daily_address">设为默认地址</label>
              </p>
              <p class="btn" id="addrSubBtn">
              [#if store??]
              <input type="hidden" name="returnUrl" value="../cart/checkout_shipping.jspx?storeId=${store.id}"/>
              [#else]
                <input type="hidden" name="returnUrl" value="../cart/checkout_shipping.jspx"/>
                [/#if]
            <input type="button" value="保存收货信息"  onclick="checkReceive();" />
            </p>
           </div>
   </div>
 </div>
 <div id="delivery_buffer_window" class="delivery mb10">
   <div class="title"><h2>确认订单信息</h2></div>
   <div class="delivery_box" id="inputUI_delivery">
   [#if store??]
              <ul  class="clearfix mt10">
              [#list store.fullGives as fullGive]
              <li>${fullGive_index+1}. ${fullGive.name!}---${fullGive.description!}</li>
               [/#list]
          </ul>
          [#else]
          [/#if]
    <table>
      <tr class="head">
        <td width="70"></td><td width="310">商品名称</td><td width="120" align="center">定金</td><td width="65" align="center">数　量</td>
        <td width="80" align="center">重量</td><td width="200" align="left">配送方式</td><td width="100" align="left">小计</td>
     </tr>
      <tr><td colspan="7">
         [#if store??]
           <div class="shop_name" align="left"> <input type="hidden" name="storeId" value="${store.id}"/>
                  &nbsp;&nbsp;店铺：${store.storeName!} &nbsp;&nbsp;卖家：${store.member.username!}                   
           </div>
           [/#if] </td>
       </tr>
      
       <tr class="body">
        <td width="70"><a class="img60" href="${product.url}" target="_blank">
                 <img src="${root!}${product.productExt.coverImg!}" width="60" height="60"/></a></td>
        <td width="310"><a href="${product.url}" title="${product.name!}" class="a2" target="_blank">
              [@text_cut s=product.name len='10' appent='...'/]
              [#if product.dingjin??]${product.dingjin!}[/#if]</a>
        </td>
        <td width="120" align="center">  [#if product.dingjin??]${product.dingjin!}[/#if]
        </td>
        <td width="65" align="center"><span id="cart_count_">${count}</span></td>
        <td width="80" align="center">
         <input type="hidden" id="cart_weight_" name="weight" value=""/>${product.weight!0}g</td>
     
        <td width="100" align="right">
      ${product.dingjin*count}
        </td>
    </tr>
    
    <tr><td colspan="7" align="right"><span class="bold">
         重量：<span id="cart_weight">${product.weight}</span>g  商品金额：<span id="cart_price">${product.dingjin*count}</span>元&nbsp;&nbsp;
         运费：<span id="cart_freght"></span>元店铺合计(不含运费，服务费)：${product.dingjin*count}¥ <span id="cart_totalfee"></span>
       <input type="hidden" id="totalFee" name="totalFee"/>
       </span></td></tr>
</table>
</div>
</div>
    
<div id="payment_buffer_window" class="delivery mb10">
  <div class="title"> <h2>支付方式</h2></div>
  <div class="delivery_box" id="inputUI_payment">
   [#list paylist as pay]
    <p id="pNet" class="radio_select">
      <input type="radio" name="payment" id="radio_money" value="${pay.id}" [#if pay.disabled]disabled[/#if] [#if pay.isDefault]checked="true"[/#if]/>
      <label for="radio_money">${pay.name!}</label>
      <span class="des" id="bankInfo"> ${pay.description!}</span>
   </p>
  [/#list]
  </div>
</div>
<div class="delivery_box" id="inputUI_delivery">
    <p class="btn"><input type="button" id="confirm_delivery" value="提交订单" onclick="checkOrder();" />&nbsp;
    </p>
 </div>
</form>
</div>
[#include "../include/页脚信息栏.html"/]
</body>
</html>
